package com.xinyue.game.client.logichandler;

import com.xinyue.game.messages.ChatMessagePush;
import com.xinyue.game.messages.ChatRequest;
import com.xinyue.game.messages.ChatResponse;
import com.xinyue.game.messages.LoginResponse;
import com.xinyue.network.hamdlermapping.GameChannelContext;
import com.xinyue.network.hamdlermapping.GameHandlerComponent;
import com.xinyue.network.hamdlermapping.GameMapping;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author 王广帅
 * @date 2021年01月28日 2:19 上午
 */
@GameHandlerComponent
public class UserHandler {
    private Logger logger = LoggerFactory.getLogger(UserHandler.class);

    @GameMapping(LoginResponse.class)
    public void login(GameChannelContext ctx, LoginResponse response) {
        logger.debug("收到登陆返回,playerId:{}", response.getPlayId());
    }
    @GameMapping(ChatResponse.class)
    public void chatResponse(GameChannelContext ctx,ChatResponse response){
        logger.debug("聊天信息发送成功");
    }
    @GameMapping(ChatMessagePush.class)
    public void receiveChatMessage(GameChannelContext ctx,ChatMessagePush chatMessagePush){
        logger.debug("{} 说：{}",chatMessagePush.getName(),chatMessagePush.getMessage());
    }

}
